'''
Created on 21/9/2012

@author: Chris
'''

import os, tkMessageBox

#=======================================================================================
def get_file_size(file_path):
#=======================================================================================
    '''
    description: check the size of file

    parameter: file_path, file path
    return   : size of file, unit kb
    '''
    
    return os.path.getsize(file_path)


#=======================================================================================
def report_exception(msg):
#=======================================================================================
    '''
    description: report exception via message box

    parameter: msg, displayed message
    '''
    
    tkMessageBox.showerror("Error", msg)
    

#=======================================================================================
def is_file_name_existed(file_name, file_path):
#=======================================================================================
    '''
    description: check if the file name is already existed under the given file path
    
    parameter: file_name, file name
    parameter: file_path, file path
    return   : size of file, unit kb
    '''
    path = file_path + "\\" + file_name
    return os.path.lexists(path)

